package com.woniu.ordernacos.service.impl;

import com.woniu.ordernacos.service.OrderService;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private RestTemplate restTemplate;

    @Override
    public boolean add() {
        //获取商品信息，发请求给库存服务
//        String url = "http://localhost:8083/goods/findById/1";
        String url = "http://goods-nacos/goods/findById/1";

        Object o = restTemplate.getForObject(url, Object.class);

        System.out.println(o);

        return false;
    }
}
